# coding=utf-8
# @Time    : 2018/2/2 14:52
# @Author  : Jiangxu
# @File    : 高级面向对象编程.py
# @Software: PyCharm
class Student(object):

	@property
	def birth(self):
		return self._birth

	@birth.setter
	def birth(self, value):
		self._birth = value

	@property
	def age(self):
		return 2018 - self._birth

	# @property
	# def score(self):
	# 	return self._score
	#
	# @score.setter
	# def score(self, value):
	# 	if not isinstance(value, int):
	# 		raise ValueError('score must be an integer!')
	# 	if value < 0 or value > 100:
	# 		raise ValueError('score must between 0 ~ 100!')
	# 	self._score = value

s = Student()
s.birth = 1998
# print s.score
print s.age